package com.aqie.common.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: aqie
 * @create: 2020-10-08 15:43
 **/
@RestController
@RequestMapping("common")
public class BaseController {
    @Autowired
    private StringRedisTemplate redisTemplate;

    @GetMapping("hello")
    public String hello() {
        redisTemplate.opsForValue().set("name", "aqie");
        String name = redisTemplate.opsForValue().get("name");
        return "hello common " + name;
    }
}
